package com.framework.plugin.xmlsql.tag;

@SuppressWarnings("rawtypes")
public enum TagEnum {
	
	IF("if", IfTag.class),
	CHOOSE("choose", ChooseTag.class),
	WHEN("when", WhenTag.class),
	OTHERWISE("otherwise", OtherwiseTag.class),
	FOREACH("foreach", ForeachTag.class);
	
	private String name;
	private Class clazz;
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Class getClazz() {
		return clazz;
	}
	public void setClazz(Class clazz) {
		this.clazz = clazz;
	}
	private TagEnum(String name, Class clazz) {
		this.name = name;
		this.clazz = clazz;
	}
	
	public static TagEnum getEnumByName(String name) {
		for(TagEnum enumtype:values()) {
			if(name.equals(enumtype.getName()))
				return enumtype;
		}
		return null;
	}
	
}
